package pers.xiaojun.boot.module.infra.controller.config.vo;

import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import pers.xiaojun.boot.common.constants.DateTimePatternConstants;
import pers.xiaojun.boot.common.pojo.PageParam;
import pers.xiaojun.boot.common.validation.constraints.InEnum;
import pers.xiaojun.boot.module.infra.enums.ConfigTypeEnum;

import java.time.LocalDateTime;

/**
 * 参数配置分页/条件查询实体
 *
 * @author xiaojun
 * @since 2025-11-09
 */
@Schema(description = "参数配置分页/条件查询实体-VO")
@EqualsAndHashCode(callSuper = true)
@Data
public class ConfigQueryReqVO extends PageParam {

    @Schema(description = "参数名称（模糊匹配）", example = "用户")
    @Size(max = 100, message = "参数名称不能超过 100 个字符")
    private String name;

    @Schema(description = "参数键名（模糊匹配）", example = "system")
    @Size(max = 100, message = "参数键名长度不能超过 100 个字符")
    private String configKey;

    @Schema(description = "参数类型", example = "1")
    @InEnum(value = ConfigTypeEnum.class, message = "参数类型必须为 {value}")
    private Integer type;

    @Schema(description = "创建时间数组", example = "[2025-11-01 00:00:00,2025-11-09 23:59:59]")
    @DateTimeFormat(pattern = DateTimePatternConstants.ISO_DATE_TIME)
    @Size(max = 2, message = "创建时间最多只能为2个")
    private LocalDateTime[] createTime;

}
